@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap&display=swap");

/* 添加暗色模式支持 */
@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #6c8fff;
    --secondary-color: #a0a8b0;
    --dark-color: #f8f9fa;
    --light-color: #1a1d20;
    --success-color: #2ebd4e;
    --danger-color: #e84c5a;
    --bg-color: #121416;
    --card-bg: #1e2124;
    --text-color: #e4e6eb;
  }
}

/* 添加减少动画支持 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

:root {
  /* 颜色变量 */
  --primary-color: #4a6bff;
  --primary-color-rgb: 74, 107, 255;
  --secondary-color: #6c757d;
  --secondary-color-rgb: 108, 117, 125;
  --dark-color: #343a40;
  --dark-color-rgb: 52, 58, 64;
  --light-color: #f8f9fa;
  --light-color-rgb: 248, 249, 250;
  --success-color: #28a745;
  --success-color-rgb: 40, 167, 69;
  --danger-color: #dc3545;
  --danger-color-rgb: 220, 53, 69;
  --bg-color: #f5f5f5;
  --card-bg: #ffffff;
  --text-color: #333;
  --border-color: rgba(0, 0, 0, 0.1);

  /* 动画持续时间变量 */
  --transition-fast: 0.2s;
  --transition-normal: 0.3s;
  --transition-slow: 0.5s;

  /* 间距变量 */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* 边框圆角变量 */
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --border-radius-xl: 16px;
  --border-radius-full: 9999px;

  /* 阴影变量 */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 12px rgba(0, 0, 0, 0.08), 0 16px 24px rgba(0, 0, 0, 0.12);
  --shadow-hover: 0 12px 20px rgba(0, 0, 0, 0.15),
    0 20px 30px rgba(0, 0, 0, 0.18);

  /* 字体大小变量 */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.5rem;

  /* 容器最大宽度 */
  --container-max-width: 1200px;
  --container-padding: 20px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  scroll-behavior: smooth;
}

/* 自定义滚动条样式 */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--primary-color), var(--success-color));
  border-radius: 6px;
  border: 3px solid var(--bg-color);
  transition: all var(--transition-normal) ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* 文本选中样式 */
::selection {
  background: rgba(var(--primary-color-rgb), 0.2);
  color: var(--primary-color);
}

/* Firefox 文本选中样式 */
::-moz-selection {
  background: rgba(var(--primary-color-rgb), 0.2);
  color: var(--primary-color);
}

/* 平滑滚动行为 */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* 为固定导航栏留出空间 */
}

/* 减少动画模式下禁用平滑滚动 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* 打印样式优化 */
@media print {
  /* 隐藏不必要的元素 */
  nav,
  .social-links,
  .project-link,
  .contact-form,
  footer {
    display: none !important;
  }

  /* 优化打印颜色 */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 确保文本可读性 */
  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
    line-height: 1.5;
  }

  /* 优化链接显示 */
  a {
    text-decoration: none !important;
    color: black !important;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    font-weight: normal;
    color: #666;
  }

  /* 确保内容不会被截断 */
  .project-card,
  .skill-card {
    break-inside: avoid;
    page-break-inside: avoid;
    background: none !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
  }

  /* 优化标题显示 */
  h1,
  h2,
  h3 {
    page-break-after: avoid;
    break-after: avoid;
  }

  /* 移除所有动画和过渡效果 */
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* 增强键盘导航可访问性 */
*:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 20px;
}

.logo a {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  text-shadow: 1px 1px 0 #fff, 2px 2px 0 rgba(74, 107, 255, 0.2),
    3px 3px 0 rgba(74, 107, 255, 0.3), 4px 4px 0 rgba(74, 107, 255, 0.4);
  transition: all 0.3s ease;
}

.logo a:hover {
  transform: translate(-2px, -2px);
  text-shadow: 1px 1px 0 #fff, 3px 3px 0 rgba(74, 107, 255, 0.2),
    5px 5px 0 rgba(74, 107, 255, 0.3), 7px 7px 0 rgba(74, 107, 255, 0.4);
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-links li {
  margin-left: 30px;
}

.nav-links li a {
  text-decoration: none;
  color: var(--dark-color);
  font-weight: 500;
  transition: color 0.3s ease;
  padding: 12px 15px; /* 增加点击区域 */
  display: inline-block;
  min-height: 44px; /* 确保触发区域足够大 */
  line-height: 20px;
  position: relative;
}

.nav-links li a:hover {
  color: var(--primary-color);
}

.nav-links li a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 15px;
  right: 15px;
  height: 2px;
  background: var(--primary-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.nav-links li a:hover::after {
  transform: scaleX(1);
}

.menu-btn {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.home {
  margin-top: 77px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(
      rgba(255, 255, 255, 0.92),
      rgba(255, 255, 255, 0.92)
    ),
    url("https://source.unsplash.com/random/1920x1080/?programming") no-repeat
      center center/cover;
  padding-top: 80px;
  box-sizing: border-box;
}

.home-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

.profile-container {
  background: rgba(255, 255, 255, 0.95);
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.profile-container:hover {
  transform: translateY(-5px);
}

.profile-image {
  width: 180px;
  height: 180px;
  margin: 0 auto 30px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--primary-color);
  box-shadow: 0 5px 15px rgba(74, 107, 255, 0.3);
  animation: float 3s ease-in-out infinite;
}

.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-content h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  color: var(--dark-color);
}

.home-content h1 span {
  color: var(--primary-color);
  position: relative;
  display: inline-block;
}

.home-content h1 span::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 3px;
  bottom: 0;
  left: 0;
  background: var(--primary-color);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s ease;
}

.home-content h1:hover span::after {
  transform: scaleX(1);
  transform-origin: left;
}

.typing-container {
  min-height: 30px;
  margin: 20px 0;
}

.typing-text {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 500;
}

.typing-text::after {
  content: "|";
  animation: blink 0.7s infinite;
}

.bio {
  font-size: 1.2rem;
  margin: 25px 0;
  color: var(--secondary-color);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin: 30px 0;
}

.social-links a {
  color: var(--dark-color);
  font-size: 1.5rem;
  transition: all 0.3s ease;
  padding: 15px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-links a:hover {
  color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(74, 107, 255, 0.3);
  background: rgba(255, 255, 255, 0.95);
}

section {
  padding: 100px 0;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 50px;
  color: var(--dark-color);
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: var(--primary-color);
}

/* 按钮基础样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-xl);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-md);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-normal) ease;
  cursor: pointer;
  min-height: 44px;
  gap: var(--spacing-sm);
  border: 2px solid transparent;
}

/* 主要按钮 */
.btn-primary {
  background-color: var(--primary-color);
  color: var(--light-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: transparent;
  color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* 次要按钮 */
.btn-secondary {
  background-color: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: var(--light-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* 按钮尺寸 */
.btn-sm {
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: var(--font-size-sm);
  min-height: 36px;
}

.btn-lg {
  padding: var(--spacing-md) var(--spacing-2xl);
  font-size: var(--font-size-lg);
  min-height: 52px;
}

/* 禁用状态 */
.btn:disabled,
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* 加载状态 */
.btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: currentColor;
  animation: spin 0.8s infinite linear;
}

.about {
  background-color: white;
}

.about-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: center;
}

.about-text {
  max-width: 800px;
  text-align: center;
}

.about-text p {
  margin-bottom: 20px;
  font-size: 1.1rem;
  color: var(--secondary-color);
}

.skills-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.skill-card {
  background-color: var(--card-bg);
  padding: 35px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(var(--primary-color-rgb), 0.1) 0%,
    rgba(var(--primary-color-rgb), 0) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.skill-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.08), 0 16px 24px rgba(0, 0, 0, 0.12);
}

.skill-card:hover::before {
  opacity: 1;
}

.skill-card i {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 25px;
  display: inline-block;
  transition: all 0.3s ease;
  position: relative;
}

.skill-card:hover i {
  transform: scale(1.1) rotate(5deg);
}

.skill-card h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--dark-color);
  position: relative;
  display: inline-block;
}

.skill-card h3::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.skill-card:hover h3::after {
  transform: scaleX(1);
}

.skill-card p {
  color: var(--secondary-color);
  line-height: 1.6;
  margin-top: 10px;
  font-size: 0.95rem;
}

.projects {
  background-color: white;
}

.projects-content {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.project-card {
  min-width: 300px;
  background-color: var(--card-bg);
  padding: 30px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--success-color)
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.08), 0 16px 24px rgba(0, 0, 0, 0.12);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--dark-color);
  position: relative;
  display: inline-block;
}

.project-card h3::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.project-card:hover h3::after {
  transform: scaleX(1);
}

.project-card p {
  margin-bottom: 20px;
  color: var(--secondary-color);
  line-height: 1.6;
  flex-grow: 1;
}

/* 链接和标签容器 */
.project-card-footer {
  margin-top: auto;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-tags span {
  background-color: var(--primary-color);
  color: white;
  padding: 5px 15px;
  border-radius: 50px;
  font-size: 0.8rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  margin: 15px 0;
  padding: 8px 16px;
  border: 2px solid var(--primary-color);
  border-radius: 50px;
  transition: all 0.3s ease;
}

.project-link:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.project-link i {
  font-size: 1.1em;
}

/* 联系部分样式优化 */
.contact-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.contact-form,
.contact-info {
  width: 100%;
  max-width: 600px;
}

.contact-form h3,
.contact-info h3 {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.info-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  text-align: center;
}

.info-item i {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.info-item div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.info-item h4 {
  margin-bottom: var(--spacing-sm);
  color: var(--primary-color);
}

.info-item p,
.info-item a {
  color: var(--text-color);
  text-decoration: none;
  transition: color var(--transition-normal) ease;
}

.info-item a:hover {
  color: var(--primary-color);
}

.form-group {
  margin-bottom: var(--spacing-md);
  text-align: center;
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-sm);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-color);
  color: var(--text-color);
  transition: all var(--transition-normal) ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.1);
}

.form-group input:hover,
.form-group textarea:hover {
  border-color: var(--primary-color);
}

.contact-form button {
  display: block;
  margin: var(--spacing-lg) auto 0;
  padding: var(--spacing-sm) var(--spacing-xl);
  background: var(--primary-color);
  color: var(--light-color);
  border: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal) ease;
}

.contact-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(var(--primary-rgb), 0.2);
}

.contact-form button:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .contact-content {
    grid-template-columns: 1fr;
  }
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  background-color: var(--card-bg);
  padding: var(--spacing-lg) var(--spacing-xl);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.1);
  transition: all var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.contact-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    var(--primary-color),
    var(--success-color)
  );
  opacity: 0;
  transition: opacity var(--transition-normal) ease;
}

.contact-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.08), 0 16px 24px rgba(0, 0, 0, 0.12);
}

.contact-item:hover::before {
  opacity: 1;
}

.contact-item i {
  font-size: 1.5rem;
  color: var(--primary-color);
  transition: transform var(--transition-normal) ease;
}

.contact-item:hover i {
  transform: scale(1.1);
}

.contact-item p {
  color: var(--secondary-color);
  font-size: 1rem;
  line-height: 1.6;
}

/* 表单样式优化 */
.contact-form {
  background-color: var(--card-bg);
  padding: var(--spacing-xl);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-sm);
  color: var(--dark-color);
  font-weight: 500;
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-lg);
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background-color: var(--card-bg);
  color: var(--text-color);
  font-size: 1rem;
  transition: all var(--transition-normal) ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(var(--primary-color-rgb), 0.1);
}

.form-control::placeholder {
  color: var(--secondary-color);
  opacity: 0.7;
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* 表单验证状态 */
.form-control.is-valid {
  border-color: var(--success-color);
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid {
  border-color: var(--danger-color);
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23dc3545' viewBox='-2 -2 7 7'%3e%3cpath stroke='%23dc3545' d='M0 0l3 3m0-3L0 3'/%3e%3ccircle r='.5'/%3e%3ccircle cx='3' r='.5'/%3e%3ccircle cy='3' r='.5'/%3e%3ccircle cx='3' cy='3' r='.5'/%3e%3c/svg%3E");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--danger-color);
}

.form-control.is-invalid ~ .invalid-feedback {
  display: block;
}

/* 提交按钮样式 */
.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md) var(--spacing-xl);
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal) ease;
  min-height: 44px;
  gap: var(--spacing-sm);
}

.submit-btn:hover {
  background-color: #3a5bff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(var(--primary-color-rgb), 0.3);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn i {
  font-size: 1.1em;
}

.submit-btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.submit-btn.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s infinite linear;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 页脚样式优化 */
footer {
  background-color: var(--dark-color);
  color: var(--light-color);
  padding: var(--spacing-xl) 0;
  position: relative;
  overflow: hidden;
}

.footer-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.footer-section {
  width: 100%;
  max-width: 600px;
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.footer-section h3 {
  color: var(--primary-color);
  font-size: 1.2rem;
  margin-bottom: var(--spacing-md);
  position: relative;
  display: inline-block;
}

.footer-section h3::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: var(--primary-color);
  transition: width var(--transition-normal) ease;
}

.footer-section:hover h3::after {
  width: 80px;
}

.footer-section p {
  color: var(--light-color);
  opacity: 0.8;
  line-height: 1.6;
  margin-bottom: var(--spacing-md);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
}

.footer-links a {
  color: var(--light-color);
  text-decoration: none;
  opacity: 0.8;
  transition: all var(--transition-normal) ease;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.footer-links a:hover {
  color: var(--primary-color);
  opacity: 1;
  transform: translateY(-2px);
}

.footer-links a i {
  font-size: 1.1rem;
}

.footer-bottom {
  text-align: center;
  padding-top: var(--spacing-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  opacity: 0.7;
  font-size: 0.9rem;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--success-color),
    var(--primary-color)
  );
  background-size: 200% 100%;
  animation: gradient 15s linear infinite;
}

.footer-content {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-xl);
  justify-items: center;
  text-align: center;
}

.footer-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--spacing-md);
  width: 100%;
  max-width: 300px;
}

.footer-section h3 {
  color: var(--light-color);
  font-size: var(--font-size-lg);
  margin-bottom: var(--spacing-sm);
  position: relative;
  display: inline-block;
  text-align: center;
  width: auto;
}

.footer-section h3::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: var(--primary-color);
  transition: width var(--transition-normal) ease;
}

.footer-section:hover h3::after {
  width: 80px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
}

.footer-links li {
  width: auto;
  text-align: center;
}

.footer-links a {
  color: var(--light-color);
  text-decoration: none;
  transition: all var(--transition-normal) ease;
  opacity: 0.8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-md);
}

.footer-links a:hover {
  opacity: 1;
  color: var(--primary-color);
  transform: translateY(-2px);
  background-color: rgba(var(--primary-color-rgb), 0.1);
}

.footer-social {
  display: flex;
  gap: var(--spacing-md);
  margin-top: var(--spacing-sm);
}

.footer-social a {
  color: var(--light-color);
  text-decoration: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  transition: all var(--transition-normal) ease;
  position: relative;
  overflow: hidden;
}

.footer-social a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-color);
  transform: translateY(100%);
  transition: transform var(--transition-normal) ease;
  z-index: 0;
}

.footer-social a:hover::before {
  transform: translateY(0);
}

.footer-social a i {
  position: relative;
  z-index: 1;
  transition: transform var(--transition-normal) ease;
}

.footer-social a:hover i {
  transform: scale(1.2);
}

.footer-bottom {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  color: var(--light-color);
  opacity: 0.8;
  font-size: 0.9rem;
}

@keyframes gradient {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 200% 0%;
  }
}

@media screen and (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 0 var(--spacing-md);
  }

  .footer-section {
    margin-bottom: var(--spacing-xl);
  }

  .footer-section h3 {
    font-size: 1.4rem;
  }

  .footer-section h3::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .footer-links {
    gap: var(--spacing-md);
  }

  .footer-links a {
    padding: var(--spacing-sm) 0;
    font-size: 1.1rem;
  }

  .footer-links a:hover {
    transform: translateX(0) scale(1.05);
  }

  .footer-bottom {
    margin-top: var(--spacing-lg);
  }

  /* 联系部分响应式优化 */
  .contact-content {
    padding: 0 var(--spacing-md);
  }

  .contact-form,
  .contact-info {
    padding: var(--spacing-lg);
  }

  .info-item {
    flex-direction: column;
    text-align: center;
    padding: var(--spacing-lg);
  }

  .info-item i {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
  }

  .form-group {
    margin-bottom: var(--spacing-lg);
  }

  .form-control {
    font-size: 16px; /* 防止iOS缩放 */
    padding: var(--spacing-md);
  }

  .submit-btn {
    width: 100%;
    padding: var(--spacing-md);
    font-size: 1.1rem;
  }
}

@media screen and (max-width: 480px) {
  .footer-section h3 {
    font-size: 1.2rem;
  }

  .footer-links a {
    font-size: 1rem;
  }

  .footer-bottom p {
    font-size: 0.8rem;
  }

  .contact-form,
  .contact-info {
    padding: var(--spacing-md);
  }

  .info-item {
    padding: var(--spacing-md);
  }

  .info-item i {
    font-size: 1.8rem;
  }

  .form-label {
    font-size: 0.9rem;
  }
}

/* 加载动画和过渡效果 */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.loaded {
  opacity: 0;
  visibility: hidden;
}

.loader {
  width: 48px;
  height: 48px;
  border: 5px solid var(--primary-color);
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 内容淡入效果 */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 内容占位符样式 */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.06) 25%,
    rgba(0, 0, 0, 0.15) 37%,
    rgba(0, 0, 0, 0.06) 63%
  );
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: 4px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.skeleton-text {
  height: 16px;
  margin-bottom: 10px;
  width: 100%;
}

.skeleton-text:last-child {
  width: 80%;
}

.skeleton-title {
  height: 24px;
  margin-bottom: 15px;
  width: 50%;
}

.skeleton-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

.skeleton-card {
  padding: 20px;
  border-radius: 8px;
  background: var(--card-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 现有动画 */
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* 页面过渡动画 */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-color);
  z-index: 9998;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

.page-transition.active {
  transform: translateY(0);
}

.page-transition.exit {
  transform: translateY(-100%);
}

@media screen and (max-width: 768px) {
  .home {
    min-height: 100vh;
    padding: 20px 0;
  }

  .profile-container {
    padding: 20px;
  }

  .profile-image {
    width: 150px;
    height: 150px;
  }

  /* 渐进式字体大小变化 */
  .home-content h1 {
    font-size: calc(2.5rem + (3.5 - 2.5) * ((100vw - 320px) / (768 - 320)));
  }

  .typing-text {
    font-size: 1.2rem;
  }

  .bio {
    font-size: 1rem;
    padding: 0 10px;
  }

  .social-links {
    gap: 15px;
  }

  .social-links a {
    font-size: 1.5rem;
  }

  /* 改进的移动端导航菜单 */
  .nav-links {
    position: fixed;
    top: 0;
    left: -100%;
    height: 100vh;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
  }

  .nav-links.active {
    left: 0;
    opacity: 1;
    visibility: visible;
  }

  .nav-links li {
    margin: 15px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
  }

  .nav-links.active li {
    opacity: 1;
    transform: translateY(0);
    transition-delay: calc(0.1s * var(--i));
  }

  .nav-links li a {
    font-size: 1.2rem;
    padding: 12px 25px;
    border-radius: 8px;
    background: transparent;
    transition: all 0.3s ease;
  }

  .nav-links li a:hover {
    background: var(--primary-color);
    color: var(--light-color);
  }

  .menu-btn {
    display: block;
    padding: 12px;
    min-width: 44px;
    min-height: 44px;
  }

  .section-title {
    font-size: 2rem;
  }
}

@media screen and (max-width: 480px) {
  .home-content h1 {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .skill-card,
  .project-card,
  .contact-item {
    padding: 20px;
  }
}

@media (min-width: 900px) {
  .projects-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .projects-content {
    grid-template-columns: 1fr;
  }
}
